OTRcvDisconnect
Identifies the cause of a connection break or of a connection rejection, acknowledges and clears the corresponding disconnection event.C INTERFACE
OSStatus OTRcvDisconnect(EndpointRef ref, TDiscon* discon);C++ INTERFACE
OSStatus TEndpoint::RcvDisconnect(TDiscon* discon);PARAMETERS
ref
- The endpoint reference of the endpoint receiving the disconnection request.
discon
- A pointer to a
TDiscon
structure that specifies any user data,
a reason for the disconnection, and a connection request sequence number.DESCRIPTION
Calling theOTRcvDisconnect
function clears the corresponding disconnection event and retrieves any user data sent with the disconnection.If you do not care about data returned with the disconnection and do not need to know the reason for the disconnection nor the sequence ID, you may specify a
nil
pointer for thediscon
parameter. In this case, the provider discards any user data associated with the disconnection.The
OTRcvDisconnect
function behaves in the same way for all modes of operation. If there is no disconnection request pending, the function returns with thekOTNoDisconnectErr
result. If there is a disconnection request pending, the function returns either thekOTNoError
orkOTBufferOverflowErr
result. In the latter instance, you need to check thediscon
field of theTEndpointInfo
structure for your endpoint and make sure that the buffer referenced by theudata.buf
field is at least as big as the value specified for thediscon
field.VALID STATES
T_DATAXFER
,T_OUTCON
,T_OUTREL
,T_INREL
,T_INCON
(when there is more than one pending disconnection request)SEE ALSO
To send an abortive disconnect, you call theOTSndDisconnect
function (page 3-149).You use the
TDiscon
structure (page 3-69) to specify that provides user data, a reason for the disconnection, and a connection request sequence number.For information on how to use this function with a TCP/IP protocol, see page 8-19 in the TCP/IP chapter.
For information on how to use this function with AppleTalk protocols, see page 13-12 in the ADSP chapter and page 15-11 in the PAP chapter.
For information on abortive and orderly disconnects, see "Terminating a Connection," beginning on page 3-30.
You examine the
discon
field of theTEndpointInfo
structure (page 3-48) to find out whether your endpoint supports sending data with the disconnection request and to determine the maximum size of such data.